<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>点点餐后台管理主页</title>
    <link rel="shortcut icon" href="https://www.baidu.com/favicon.ico" type="image/x-icon">
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet">
</head>
<body>
<div class="layui-layout layui-layout-admin" >
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">点点餐后台管理</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
            <li class="layui-nav-item layui-hide-xs"><a href="feedsList.html" target="main">投诉与反馈</a></li>
            <li class="layui-nav-item layui-hide-xs"><a href="ordersList.html" target="main">订单列表</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">

                    <img th:src="@{/ddc/default.jpg}"
                         class="layui-nav-img">
                    个人中心
                </a>
                <dl class="layui-nav-child">
                    <dd><a th:text="'用户:'+${session.admin?.adminName}"></a></dd>
                    <dd><a href="javascript:void(0)" onclick="upData()">修改密码</a></dd>
                    <dd><a  onclick="logout()" >退出系统</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">店铺管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="shopList.html" target="main">查看所有店铺</a></dd>
                        <dd><a href="addShop.html" target="main">增加店铺</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="userList.html" target="main">查看所有用户</a></dd>
                        <dd><a href="addUser.html" target="main">增加用户</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="menuList.html" target="main">查看所有菜品</a>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body" style="padding-bottom: 0px;height: 90%;">
        <!-- 内容主体区域 -->
        <iframe width="100%" height="100%" name="main" style="border: none">
        </iframe>
    </div>

</div>
<script th:src="@{/layui/layui.js}"></script>
<script>
    function logout(){
        location.href='http://localhost:8080/admin/logout';
        parent.location.reload();
    }
    function upData() {
        layer.open({
            title: '修改密码',
            type: 2,
            content: 'upPassword.html',
            area: ['400px', '460px'],
            resize: false,
            anim: 2,
            btn: '关闭',
            // btnAlign: 'c', //按钮居中
            // shade: 0 ,//不显示遮罩
            yes: function () {
                layer.closeAll();
            }
        })
    }

    //JS
    layui.use(['element', 'layer', 'util'], function () {
        var element = layui.element
            , layer = layui.layer
            , util = layui.util
            , $ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function (othis) {
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
        });
    });
</script>
</body>
</html>